import React from 'react';
import { useNavigate } from 'react-router-dom';
import { Row, Col, Button } from 'antd';
import './index.less';

const NotFound: React.FC = () => {
    const navigate = useNavigate();
    const handleBackHome = () => {
        navigate('/admin/home', { replace: true });
    };
    return (
        <Row className="not-found">
            <Col className="left" span={12} />
            <Col className="right" span={12}>
                <h1>404</h1>
                <h2>抱歉，你访问的页面不存在</h2>
                <div>
                    <Button type="primary" onClick={handleBackHome}>回到首页</Button>
                </div>
            </Col>
        </Row>
    );
};

export default NotFound;